﻿using BLL;
using BLL.YQZS;
using System;
using System.Threading.Tasks;
using System.Web.Http;

namespace YQFK.Controllers
{
    public class YqdataController : ApiController
    {
        private YqdataBLL bll = new YqdataBLL();

        #region 获取疫情数据
        /// <summary>
        /// 获取疫情数据
        /// </summary>
        /// <param name="type"></param>
        /// <param name="time"></param>
        /// <returns></returns>
        [HttpGet]
        [Route("api/yqdata/get")]
        public object GetTreeList(int type = 0)
        {
            try
            {
                var data = bll.getYqdata(type, DateTime.Now);

                return new { code = 0, count = 0, info = "获取成功!", data = data };
            }
            catch (Exception ex)
            {
                return new { code = -1, count = 0, info = ex.Message };
            }
        }
        #endregion

    }
}